import { apiUrl } from '@/api/url';
import $http from '@/api/http';

//正向接口
export const usdtApi = {
    getAccount: (params) => $http._get(`${apiUrl.trade}prism/query/account`, params), //正向资产信息
    getQryMarginRate: (params) => $http._post(`${apiUrl.trade}action/v1.0/SendQryMarginRate`, params), //获取梯度保证金
    SendPositionMerge: (params) => $http._post(`${apiUrl.trade}action/v1.0/SendPositionMerge`, params), //仓位合并
}
//媒体报道
export const mediaList = (params) => $http.post(`${apiUrl.wapi}api/common/media/list`, params)

// 同步token到交易系统
export const syncToken = () => $http.post(`${apiUrl.wapi}user/sync-token`)
// 控制USDC是否展示
export const productList = () => $http.post(`${apiUrl.wapi}api/common/product/list`, {})
//手续费率
export const getQryFee = (params) => $http._post(`${apiUrl.trade}action/v1.0/SendQryFee`, params)
//设置追踪出场价
export const setTackPrice = (params) => {
    if (
        window.SwapTradeForbInfo &&
        window.SwapTradeForbInfo.ip_access &&
        window.SwapTradeForbInfo.ip_access.swap_forbiden
    ) {
        return new Promise((resolve) => {
            resolve({
                retCode: 9111100010,
            })
        })
    }
    if (
        window.SwapTradeForbInfo &&
        window.SwapTradeForbInfo.area_code_access &&
        window.SwapTradeForbInfo.area_code_access.swap_forbiden
    ) {
        return new Promise((resolve) => {
            resolve({
                retCode: 9111100011,
            })
        })
    }
    return $http.post(`${apiUrl.wapi}per-order/set-track-price`, params)
}
//追踪出场订单列表
export const getTackOrderList = (params) => $http.get(`${apiUrl.wapi}per-order/get-track-list`, params)
//获取追踪出场列表
export const getTackPrice = () => $http.get(`${apiUrl.wapi}per-order/get-track-price`)
//获取账户列表
export const getAccountList = (params) => $http.post(`${apiUrl.wapi}user-account/account-list`, params)
//自选行情价
export const priceByOption = (params) => $http.get(`${apiUrl.wapi}common/price-by-option`, params)
//获取K线历史数据
export const getKline = (params, timeout) => $http.get(`${apiUrl.trade}query/v1.0/kline`, params, timeout)
//获取系统通知
export const notice = () => $http.post(`${apiUrl.wapi}notice/system-notice`, {})
//币种收藏列表
export const favorList = (params = {}) => $http.post(`${apiUrl.wapi}api/currency/currencyfavor/favor-list`, params)
//币种收藏/取消
export const handleFavor = (params) => $http.post(`${apiUrl.wapi}api/currency/currencyfavor/handle-favor`, params)
//创建自定义账户
export const createUserAccount = (params) => $http.post(`${apiUrl.wapi}user-account/create-user-account`, params)
//扫码登录(获取token)
export const goScanLogin = (params) => $http.post(`${apiUrl.wapi}center/common/scan-login`, params)
//扫码登录(获取uuid)
export const scanloginGetuuid = (params = {}) => $http.post(`${apiUrl.wapi}api/scanlogin/scanlogin/uuid`, params)
//扫码登录(查询扫码结果)
export const scanloginStatus = (params = {}) => $http.post(`${apiUrl.wapi}api/scanlogin/scanlogin/scan-status`, params)
//拉取现货列表
export const spotInstrumentList = () => $http.post(`${apiUrl.wapi}site/spot-instrument-list`, {})
//拉取账户列表
export const listAccountTypeByUid = (params) =>
    $http.post(`${apiUrl.wapi}user-account/list-account-type-by-uid`, params)
//删除自定义账户
export const delUserAccount = (params) => $http.post(`${apiUrl.wapi}user-account/del-user-account`, params)
//编辑自定义账户
export const modifyAccountName = (params) => $http.post(`${apiUrl.wapi}user-account/modify-account-name`, params)
//用户交易类型
export const tradeType = (params) => $http.post(`${apiUrl.wapi}trade/type`, params)
//用户资金流水
export const tradeRecord = (params) => $http.post(`${apiUrl.wapi}trade/record`, params)
//总览（体验金账户归属主账户）
export const statisticsBalanceNew = (params) => $http.get(`${apiUrl.wapi}v1/balance/statistics-balance-new`, params)
//根据account_id获取资产
//获取比赛账户资产
export const gameBalance = (params) => $http.post(`${apiUrl.wapi}v1/balance/game-balance`, params)
//发送验证码
export const sendSms = (params) => {
    //如果是手机，则拼接区号
    if (params.mobile && !params.mobile.includes('@') && window.areaCode && !params.mobile.includes('+')) {
        params.mobile = '(' + window.areaCode + ')' + params.mobile
    }
    return $http.post(`${apiUrl.wapi}site/send-sms`, params)
}
//判断邀请码是否可以注册
export const canRegister = (params) => $http.post(`${apiUrl.wapi}common/can-register`, params)
// 根据IP判断国家
export const countryByIp = (params = {}) => $http.get(`${apiUrl.wapi}api/common/country/country`, params)
//手机区号国家列表
export const countryList = (params = {}) => $http.get(`${apiUrl.wapi}country/list`, params)
//用户访问控制
export const accessList = (params) => $http.post(`${apiUrl.wapi}user-access/list`, params)
//禁止登录、注册
export const unloginedAccess = (params) => $http.post(`${apiUrl.wapi}country/unlogined-access`, params)
//是否禁止交易
export const loginedAccess = (params) => $http.post(`${apiUrl.wapi}country/logined-access`, params)
//切换账户，提交账号登录记录
export const switchLogin = (params) => $http.post(`${apiUrl.wapi}user-account/switch-login`, params)
//已登录用户是否需要踢掉
export const loginedCheck = (params) => $http.post(`${apiUrl.wapi}country/login-check`, params)
//验证码登录
export const codeLogin = (params) => $http.post(`${apiUrl.wapi}site/new-login`, params)
//邀请返佣-邀请链接
export const shareLink = (params) => $http.post(`${apiUrl.wapi}site/create-url?typeString=invitation`, params)
//邀请返佣-用户信息
export const partnerInfo = (params) => $http.post(`${apiUrl.wapi}community/partner-info`, params)
//邀请返佣-返佣列表
export const partnerRecord = (params) => $http.post(`${apiUrl.wapi}community/partner-record`, params)
//邀请返佣-月数据信息
export const monthRecord = (params) => $http.post(`${apiUrl.wapi}community/month-record`, params)
export const codeReg = (params) => $http.post(`${apiUrl.wapi}site/new-register`, params)
//拉取资产
export const getLeftMoney = (params) => $http.post(`${apiUrl.wapi}transaction/left-money`, params)
//拉取合约资产
export const getLeftAccount = (params) => $http.get(`${apiUrl.wapi}reverse-contract/account`, params)
//充币币种配置
export const depositConfig = (params) => $http.post(`${apiUrl.wapi}currency-transaction/config`, params)
export const depositConfig1 = (params) => $http.get(`${apiUrl.wapi}v1/currency-transaction/config`, params)
//获取币种配置列表
export const symbolList = (params) => $http.get(`${apiUrl.wapi}v1/currency-transaction/symbol-list`, params)

//BBJ冲币历史列表
export const inmoneyList = (params) => $http.post(`${apiUrl.wapi}currency-transaction/inmoney-list`, params)
// 新充币列表
export const rechargeList = (params) => $http.get(`${apiUrl.wapi}coin-transaction/v1/recharge-list`, params)
//BBJ提币历史列表
export const outmoneyList = (params) => $http.post(`${apiUrl.wapi}currency-transaction/outmoney-list`, params)
// 新提币列表
export const withdrawList = (params) => $http.get(`${apiUrl.wapi}coin-transaction/v1/withdraw-list`, params)
// 设置目标账户
export const setTargetAccount = (params) => $http.post(`${apiUrl.wapi}coin-transaction/v1/set-target-account`, params)
// 获取目标账户
export const getTargetAccount = (params) => $http.get(`${apiUrl.wapi}coin-transaction/v1/get-target-account`, params)
// 获取提币列表
export const withdrawCoinList = (params) => $http.get(`${apiUrl.wapi}coin-transaction/v1/get-coin-list`, params)
//实名认证
export const verifiedFun = (params) => $http.post(`${apiUrl.wapi}user/verified`, params)
//pc拉取用户信息
export const getUserInfo = (params) => $http.post(`${apiUrl.wapi}user/user-info`, params)
//app拉取用户信息
export const getUserInfo2 = (params) => $http.post(`${apiUrl.mapi}user/user-info`, params)
//获取实名认证信息
export const verifiedInfo = (params) => $http.post(`${apiUrl.wapi}user/verified-info`, params)
//修改用户昵称
export const updateUserInfo = (params) => $http.post(`${apiUrl.wapi}user/update`, params)
//各种配置
export const siteConfig = (params) => $http.post(`${apiUrl.wapi}site/config`, params)
//币种分类接口
export const listSymbolByLabel = (params = {}) => $http.post(`${apiUrl.wapi}common/list-symbol-by-label`, params)
//判断是腾讯滑块验证还是极验
export const stateConfig = (params) => $http.post(`${apiUrl.wapi}common/state-config`, params)
//通用配置
export const commonConfig = (params) => $http.post(`${apiUrl.wapi}common/config`, params)
//根据邀请码判断是否允许手机号注册
export const configAccess = (params) => $http.get(`${apiUrl.wapi}site/config-access`, params)
//返佣划转
export const transferPartner = (params) => $http.post(`${apiUrl.wapi}transfer/partner`, params)
//划转
export const transfer = (params) => $http.post(`${apiUrl.wapi}transfer`, params)
//根据币种查询划转记录
export const partnerList = (params) => $http.post(`${apiUrl.wapi}transfer/partner-list`, params)
//提币
export const outmoney = (params) => $http.post(`${apiUrl.wapi}currency-transaction/outmoney`, params)
export const withdraw = (params) => $http.post(`${apiUrl.wapi}coin-transaction/v1/withdraw`, params)
//otc币种配置
export const otcConfig = (params) => $http.post(`${apiUrl.wapi}site/otc-config`, params)
//新版实名认证信息
export const kycInfo = () => $http.post(`${apiUrl.wapi}user/kyc-info`, {})
//otc币种配置(需要登录，且有用户余额信息)
export const otcConfig2 = (params) => $http.post(`${apiUrl.wapi}otc/otc-config`, params)
//通知列表
export const notifyData = (params) => $http.post(`${apiUrl.wapi}user/notify`, params)
//资讯列表
export const newsData = (params) => $http.post(`${apiUrl.wapi}site/news`, params)
//资讯详情
export const newsInfo = (params) => $http.post(`${apiUrl.wapi}site/short-news-detail`, params)
//退出登录
export const layOutFun = (params) => $http.post(`${apiUrl.wapi}user/logout`, params)
//根据币种获取价格(otc)
export const getPriceByCoin = (params) => $http.post(`${apiUrl.wapi}site/price`, params)
//获取支付方式配置(otc)
export const getPayMethod = () => $http.post(`${apiUrl.wapi}site/otc-pay-config`, {})
//判断用户收款方式配置信息(otc)
export const payMethods = (params) => $http.post(`${apiUrl.wapi}transaction/pay-methods`, params)
//添加收款方式(otc)
export const bindCard = (params) => $http.post(`${apiUrl.wapi}transaction/bind-card`, params)
//编辑收款方式(otc)
export const modifyCard = (params) => $http.post(`${apiUrl.wapi}transaction/modify-card`, params)
//获取首页Banner
export const getBanner = () => $http.get(`${apiUrl.wapi}site/new-get-banner`, {})
//获取首页新闻资讯
export const getIndexNews = () => $http.get(`${apiUrl.wapi}site/get-notice`, {})
//购买订单列表(otc)
export const otcInmoneyList = (params) => $http.post(`${apiUrl.wapi}otc/inmoney-list`, params)
//根据状态查询买入订单列表(otc)
export const otcInmoneyListByState = (params) => $http.post(`${apiUrl.wapi}transaction/inmoney-list`, params)
//根据状态查询卖出订单列表(otc)
export const otcOutmoneyListByState = (params) => $http.post(`${apiUrl.wapi}transaction/outmoney-list`, params)
//下单(otc)
export const otcInmoney = (params) => $http.post(`${apiUrl.wapi}otc/inmoney`, params)
//购买订单详情(otc)
export const inmoneyDetail = (params) => $http.post(`${apiUrl.wapi}otc/inmoney-detail`, params)
//出售订单详情(otc)
export const outmoneyDetail = (params) => $http.post(`${apiUrl.wapi}otc/outmoney-detail`, params)
//取消购买订单(otc)
export const cancelInmoney = (params) => $http.post(`${apiUrl.wapi}otc/cancel-inmoney`, params)
//确认购买订单(otc)
export const confirmInmoney = (params) => $http.post(`${apiUrl.wapi}otc/confirm-inmoney`, params)
//出售下单接口(otc)
export const outmoneyNew = (params) => $http.post(`${apiUrl.wapi}otc/outmoney-new`, params)
//添加提币地址
export const addressAdd = (params) => $http.post(`${apiUrl.wapi}currency-address/add`, params)
//删除提币地址
export const addressDel = (params) => $http.post(`${apiUrl.wapi}currency-address/delete`, params)
//编辑提币地址
export const addressEdit = (params) => $http.post(`${apiUrl.wapi}currency-address/edit`, params)
//提币地址列表
export const addressList = (params) => $http.post(`${apiUrl.wapi}currency-address/list`, params)
//获取币种地址-链类型
export const getChainType = () => $http.get(`${apiUrl.wapi}currency-address/chain-type`)
//钱包账单
export const walletBill = (params) => $http.get(`${apiUrl.wapi}wallet-bill/index`, params)
//邀请返佣排行榜
export const invitation = (params) => $http.get(`${apiUrl.wapi}rank/invitation`, params)
//消息设为已读
export const notifyRead = (params) => $http.get(`${apiUrl.wapi}user/notify-read`, params)
//获取公告列表
export const announceMent = (params) => $http.get(`${apiUrl.wapi}site/announcement-list`, params)
//获取常见问题
export const qlListApi = (params) => $http.get(`${apiUrl.wapi}site/qa-list`, params)
//获取 新闻|资讯|公告 详情
export const qlInfoApi = (params) => $http.get(`${apiUrl.wapi}site/news-info`, params)
//获取邀请记录信息-添加记录
export const inviteListApi = (params) => $http.post(`${apiUrl.wapi}partner/invite-list`, params)
//获取首页otc 配置
export const indexOtcCfg = () => $http.get(`${apiUrl.wapi}site/otc-cfg`, {})

//合约账户余额
export const pcBalance = () => $http.get(`${apiUrl.wapi}pc/balance`, {})

//pc获取用户资产[我的资产界面]
export const newMyBalance = () => $http.post(`${apiUrl.wapi}user/new-balance`)

//app获取用户资产
export const newMyBalance2 = () => $http.post(`${apiUrl.mapi}user/new-balance`)

//合约账单
export const accountList = (params) => $http.post(`${apiUrl.wapi}account-detail-perpetual/list`, params)

//合约类型
// export const contractType =  (params)  => $http.get('/contract?pageIndex=1&pageSize=5',params,1)

//现货行情快照
export const marketdataSpot = (params) => $http.get(`${apiUrl.trade}spotquery/v1.0/marketdata`, params)

//合约K线历史
export const swapQueryKline = (params, timeout) => $http.post(`${apiUrl.trade}query/v1.0/kline`, params, timeout)

//获取七牛token
export const getQNtoken = (params) => $http.post(`${apiUrl.wapi}user/qiniu-token`, params)

/**
 * @description 用户头像上传
 */
export const headImg = (params) => $http.post(`${apiUrl.wapi}user/modify-head-img`, params)

/**
 * 获取aws预上传链接等信息
 */
export const getUploadParams = ({ path, classify }) =>
    $http.post(`${apiUrl.wapi}api/upload/upload/presign`, { path, classify })

//获取VIP等级信息
export const levelInfo = (params) => $http.get(`${apiUrl.wapi}site/level-intro`, params)

//获取累计交易量总览
export const tradeOverview = (params) => $http.get(`${apiUrl.wapi}api/user/tradestats/overview`, params)

//获取累计交易明细
export const tradeDetail = (params) => $http.get(`${apiUrl.wapi}api/user/tradestats/daily`, params)

/**
 * 设置语言
 * @param params 语言类型：zn  en  jp
 */
export const setLanguage = (params) => $http.post(`${apiUrl.wapi}user/set-language`, params)

/**
 * 体验金信息
 */
export const missionInfo = () => $http.get(`${apiUrl.wapi}site/experience-mission`)

/**
 * @description 体验金进度
 */
export const missionProg = () => $http.get(`${apiUrl.wapi}experience-money/progress`)

/**
 * @description 体验金总和
 */
export const missionPosses = () => $http.get(`${apiUrl.wapi}experience-money/possess`)

/**
 * @description 获取体验金金额
 */
export const exMoney = (params) => $http.post(`${apiUrl.wapi}reverse-contract/ex-money`, params)

/**
 * @description 体验金列表
 */
export const expGetList = (params) => $http.post(`${apiUrl.wapi}experience-gold/list-coupon`, params)

/**
 * @description 领取体验金
 */
export const expReceive = (params) => $http.post(`${apiUrl.wapi}experience-gold/adopt-coupon`, params)

/**
 * @description 领取体验金-是否需要合并
 */
export const expCheckCoupon = (params) => $http.post(`${apiUrl.wapi}experience-gold/check-coupon-use`, params)

/**
 * @description 首页领取体验金
 */
export const couponNotice = () => $http.post(`${apiUrl.wapi}experience-gold/coupon-notice`, {})

/**
 * @description 体验金-划转信息
 */
export const expTransfer = (params) => $http.post(`${apiUrl.wapi}experience-gold/list-transfer-remark`, params)

/**
 * @description 体验金-首页弹窗提示
 */
export const expNotice = () => $http.post(`${apiUrl.wapi}api/bonus/bonus/notice`, {})

/**
 * @description 体验金-券列表
 */
export const expListCoupon = (params) => $http.post(`${apiUrl.wapi}api/bonus/bonus/list-coupon`, params)

/**
 * @description 体验金-新-领取
 */
export const expAdopt = (params) => $http.post(`${apiUrl.wapi}api/bonus/bonus/adopt`, params)

/**
 * @description 体验金-当前交易量
 */
export const tradeAmount = (params) => $http.post(`${apiUrl.wapi}bonus/current-trade-amount`, params)

/**
 * @description 体验金-可划转额度
 */
export const transferAmount = (params) => $http.post(`${apiUrl.wapi}bonus/can-transfer-amount`, params)

/**
 * @description 体验金-展示交易量
 */
export const showTransAmount = (params) => $http.post(`${apiUrl.wapi}bonus/show-trade-amount`, params)

/**
 * @description 获取法币汇率
 */
export const currencyRate = () => $http.post(`${apiUrl.wapi}common/currency-rate`)

/**
 * @description 返佣账户资金流水
 * @param params 请求参数：查询条件
 */
export const getAgentRecord = (params) => $http.get(`${apiUrl.wapi}account/agent-record`, params)

/**
 * @description 返佣账户余额
 * @param params 查询参数
 */
export const getBalanceNumber = (params) => $http.get(`${apiUrl.wapi}account/agent-balance`, params)

/**
 * @description 返佣划转到其他账户
 * @param params 请求参数
 */
export const transferNum = (params) => $http.post(`${apiUrl.wapi}account/agent-out-money`, params)

/**
 * @description 返佣账户估值
 */
export const agentVal = () => $http.post(`${apiUrl.wapi}account/agent-val`)

export const getAgentType = () => $http.get(`${apiUrl.wapi}account/agent-record-type`)
//查询出入金
export const searchInOutAPI = (params) => $http.post(`${apiUrl.wapi}trade/list`, params)
//获取账户 划转列表
export const getTransList = () => $http.post(`${apiUrl.wapi}user-account/list-account-for-transfer`)
//获取对应账户 资产信息
export const accountBalance = (params) => $http.get(`${apiUrl.wapi}v1/balance/account-balance`, params)

//账户对应资金流水
export const getRecord = (params) => $http.post(`${apiUrl.wapi}trade/record`, params)

//获取仓位梯度保证金列表
export const getSymbolList = (params) => $http.post(`${apiUrl.wapi}position-grade/list-by-symbol`, params)

//pc生成分享短链
export const shortUrl = (params) => $http.post(`${apiUrl.wapi}user/short-url`, params)
//app生成分享短链
export const shortUrl2 = (params) => $http.post(`${apiUrl.mapi}user/short-url`, params)
//获取币种列表
export const newSymbolList = (params) => $http.post(`${apiUrl.wapi}common/symbol-list`, params)

//DC中心
export const DCenter = () => $http.get(`${apiUrl.wapi}dc-center/index`, {})
//挖矿记录
export const miningList = (params = {}) => $http.get(`${apiUrl.wapi}dc-center/mining-list`, params)
//解锁记录
export const unlockList = (params) => $http.get(`${apiUrl.wapi}dc-center/unlock-list`, params)
//反向永续合约相关接口
export const fxhyApi = {
    register: (params) => $http.post(`${apiUrl.wapi}reverse-contract/register`, params), //开通反向合约
    capitalReport: (params) => $http.get(`${apiUrl.wapi}reverse-config/capital-rate-report`, params), //历史资金费率
    accountDetail: (params) => $http.get(`${apiUrl.wapi}reverse-contract/account-detail`, params), //查询资金流水
    inmoney: (params) => $http.post(`${apiUrl.wapi}reverse-contract/inmoney`, params), //划转:从钱包账户 -> 反向合约账户
    outmoney: (params) => $http.post(`${apiUrl.wapi}reverse-contract/outmoney`, params), //划转:从反向合约账户 -> 钱包账户
    transferApi: (params) => $http.post(`${apiUrl.wapi}transfer/transfer`, params), //划转接口
    spotCurrencyList: (params) => $http.post(`${apiUrl.wapi}site/spot-currency-list`, params), //获取币种配置
    account: (params) => $http.get(`${apiUrl.wapi}reverse-contract/account`, params), //查询【反向合约账户】资金
    reversOrder: (params) => {
        //下单接口 [买卖开平]
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden &&
            params.OffsetFlag === '0'
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden &&
            params.OffsetFlag === '0'
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100011,
                })
            })
        }
        return $http._post(`${apiUrl.trade}action/v1.0/SendOrderInsert`, params)
    },
    editBond: (params) => $http.post(`${apiUrl.wapi}reverse-contract/margin`, params), //[增加|减少]保证金
    cancelOrder: (params) => {
        //下单接口 [买卖开平]
        // if(window.SwapTradeForbInfo && window.SwapTradeForbInfo.ip_access && window.SwapTradeForbInfo.ip_access.swap_forbiden){
        //     return new Promise(resolve => {
        //         resolve({
        //             retCode:9111100010,
        //         })
        //     })
        // }
        // if(window.SwapTradeForbInfo && window.SwapTradeForbInfo.area_code_access && window.SwapTradeForbInfo.area_code_access.swap_forbiden){
        //     return new Promise(resolve => {
        //         resolve({
        //             retCode:9111100011,
        //         })
        //     })
        // }
        //撤单
        return $http._post(`${apiUrl.trade}action/v1.0/SendOrderAction`, params)
    },
    editLevel: (params) => {
        //调整合约杠杆
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden &&
            params.ActionType !== 'a'
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden &&
            params.ActionType !== 'a'
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100011,
                })
            })
        }
        return $http._post(`${apiUrl.trade}action/v1.0/SendPositionAction`, params)
    },
    defaultLever: (params) => $http.post(`${apiUrl.wapi}reverse-contract/default-lever`, params), //调整用户默认杠杆倍数
    switchWarehouse: (params) => $http.post(`${apiUrl.wapi}reverse-contract/switch-warehouse`, params), //[逐仓|全仓]切换
    completedOrder: (params) => $http._get(`${apiUrl.trade}query/v1.0/history_order`, params), //查询已成交
    tradeOrder: (params) => $http._get(`${apiUrl.trade}query/v1.0/trade`, params), //查询全部已成交
    positionOrder: (params) => $http._get(`${apiUrl.trade}query/v1.0/position`, params), //查询持仓单
    cancelOrders: (params) => $http._get(`${apiUrl.trade}query/v1.0/canceled_order`, params), //查询已撤单接口
    checkOpenStatus: () => $http.post(`${apiUrl.wapi}reverse-contract/check-open-reverse-contract`), //检测用户是否开通了反向合约
    contractList: (params) => $http.get(`${apiUrl.wapi}reverse-config/contract-list`, params), //查询合约列表
    orderRate: (params) => $http.get(`${apiUrl.wapi}reverse-config/order-rate`, params), //查询费率相关信息
    decimalInfo: (params) => $http.get(`${apiUrl.wapi}reverse-config/decimal-config`, params), //查询小数位数信息
    conditionList: (params) => $http.get(`${apiUrl.wapi}reverse-contract/conditional-entrustment-list`, params), //获取条件委托列表
    entrustHistory: (params) => $http.get(`${apiUrl.wapi}reverse-contract/conditional-entrustment-history`, params), //获取历史条件委托
    setCondition: (params) => $http.post(`${apiUrl.wapi}reverse-contract/add-conditional-entrustment`, params), //设置条件委托
    cancellCondition: (params) => $http.post(`${apiUrl.wapi}reverse-contract/cancell-conditional-entrustment`, params), //取消条件委托
    getdefaultLever: () => $http.get(`${apiUrl.wapi}reverse-contract/get-default-lever`), //获取默认杠杆
    riskFund: (params) => $http.get(`${apiUrl.wapi}reverse-config/risk-fund`, params), //获取风险保障基金
    tradeDetail: (params) => $http.get(`${apiUrl.wapi}reverse-contract/trade-detail`, params), //根据ID查询成交详情
    revokeAll: () => {
        //批量撤销用户的所有订单
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100011,
                })
            })
        }
        return $http.post(`${apiUrl.wapi}reverse-contract/revoke-all`)
    },
    editOrderStop: (params) => {
        //修改止盈止损
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100011,
                })
            })
        }
        return $http.post(`${apiUrl.wapi}reverse-contract/edit-order`, params)
    },
    getContractListLink: (params) => $http._get(`${apiUrl.trade}query/v1.0/contract`, params), //获取合约列表-交易系统
    checkOtoken: () => $http._get(`${apiUrl.trade}query/v1.0/check_token`), //check otoken
    sendCloseOrderInsert: (params) => {
        //下单-止盈止损
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100011,
                })
            })
        }
        return $http._post(`${apiUrl.trade}action/v1.0/SendCloseOrderInsert`, params)
    },
    SendTriggerOrderInsert: (params) => {
        //下单-条件委托-交易系统
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden &&
            params.BusinessType === 'W'
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden &&
            params.BusinessType === 'W'
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100011,
                })
            })
        }
        return $http._post(`${apiUrl.trade}action/v1.0/SendTriggerOrderInsert`, params)
    },
    triggerOrder: (param) => $http._get(`${apiUrl.trade}query/v1.0/trigger_order`, param), //获取条件委托-交易系统
    SendTrigOrderAction: (params) => {
        //条件委托-撤单
        // if(window.SwapTradeForbInfo && window.SwapTradeForbInfo.ip_access && window.SwapTradeForbInfo.ip_access.swap_forbiden){
        //     return new Promise(resolve => {
        //         resolve({
        //             retCode:9111100010,
        //         })
        //     })
        // }
        // if(window.SwapTradeForbInfo && window.SwapTradeForbInfo.area_code_access && window.SwapTradeForbInfo.area_code_access.swap_forbiden){
        //     return new Promise(resolve => {
        //         resolve({
        //             retCode:9111100011,
        //         })
        //     })
        // }
        return $http._post(`${apiUrl.trade}action/v1.0/SendTriggerOrderAction`, params)
    },
    HistoryTriOrder: (params) => $http._get(`${apiUrl.trade}query/v1.0/history_trigger_order`, params), //条件委托-历史-交易系统
    MemberPosition: (params) => $http._get(`${apiUrl.trade}query/v1.0/MemberPosition`, params), //获取分仓杠杆
    finishOrder: (params) => $http._get(`${apiUrl.trade}query/v2.0/finish-orders`, params), //查询历史委托-限价委托
    finishTriggerOrder: (params) => $http._get(`${apiUrl.trade}query/v2.0/finish-trigger-orders`, params), //查询历史委托-条件委托
    finishTrades: (params) => $http._get(`${apiUrl.trade}query/v2.0/trades`, params), //查询成交记录
    SendPositionReverse: (params) => {
        //市价反手
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100011,
                })
            })
        }
        return $http._post(`${apiUrl.trade}action/v1.0/SendPositionReverse`, params)
    },
    finishOrderV3: (params) => $http._get(`${apiUrl.trade}query/v3.0/finish-orders`, params), //查询历史委托-近三个月
    tradesV3: (params) => $http._get(`${apiUrl.trade}query/v3.0/trades`, params), //合约查询成交记录(近3个月)
    finishTriggerOrderV3: (params) => $http._get(`${apiUrl.trade}query/v3.0/finish-trigger-orders`, params), //合约查询历史条件单(近3个月)
    oldList: (params) => $http.get(apiUrl.wapi + 'api/order/trace/old-list', params), //追踪出场-历史
    traceShow: (params) => $http.get(apiUrl.wapi + 'api/order/trace/show', params), //追踪出场-历史-详情
    SendQryLeverage: (params) => $http._post(`${apiUrl.trade}action/v1.0/SendQryLeverage`, params), //新的获取杠杆接口
    SendBatch: (params) => $http._post(`${apiUrl.trade}query/v1.0/SendBatch`, params), //资产、持仓、限价、条件接口整合
    getConfigTrade: (params) => $http.post(`${apiUrl.wapi}api/common/config/trade`, params), //查询当前交易对的配置信息
    SendCloseOrderAction: (params) => {
        //下单-改单-限价去掉止盈止损
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100011,
                })
            })
        }
        return $http._post(`${apiUrl.trade}action/v1.0/SendCloseOrderAction`, params)
    },
    getQueryMember: (params) => $http._post(`${apiUrl.trade}action/v1.0/SendQryMember`, params), //查询当前仓位模式
    SendMemberAction: (params) => $http._post(`${apiUrl.trade}action/v1.0/SendMemberAction`, params), //设置-仓位模式 1双向持仓 2净仓
    swapRVK: (params) => {
        //一键撤单
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    code: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    code: 9111100011,
                })
            })
        }
        return $http.post(`${apiUrl.trade}prism/action/swap/rvk`, params)
    },
    swapClosePos: (params) => {
        //一键全平
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    code: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    code: 9111100011,
                })
            })
        }
        return $http.post(`${apiUrl.trade}prism/action/swap/closePos`, params)
    },
    triggerRvk: (params) => $http.post(`${apiUrl.trade}prism/action/swap/trigger-rvk`, params), //指标单 一键撤单
    SendPositionLeverage: (params) => $http._post(`${apiUrl.trade}action/v1.0/SendPositionLeverage`, params), //多空不同屏-杠杆信息
}

//合约新接口-鹏飞
export const SwapApi = {
    //下单接口 [买卖开平]
    SendOrderInsert: (params) => {
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden &&
            params.OffsetFlag === '0'
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden &&
            params.OffsetFlag === '0'
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100011,
                })
            })
        }
        return $http.post(`${apiUrl.trade}v2/public/cpt/SendOrderInsert`, params)
    },

    //下单-条件委托-交易系统
    SendTriggerOrderInsert: (params) => {
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden &&
            params.BusinessType === 'W'
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden &&
            params.BusinessType === 'W'
        ) {
            return new Promise((resolve) => {
                resolve({ retCode: 9111100011 })
            })
        }
        return $http.post(`${apiUrl.trade}v2/public/cpt/SendTriggerOrderInsert`, params)
    },

    //下单-止盈止损
    SendCloseOrderInsert: (params) => {
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({ retCode: 9111100010 })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({ retCode: 9111100011 })
            })
        }
        return $http.post(`${apiUrl.trade}v2/public/cpt/SendCloseOrderInsert`, params)
    },

    //调整合约杠杆
    SendPositionAction: (params) => {
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden &&
            params.ActionType !== 'a'
        ) {
            return new Promise((resolve) => {
                resolve({ retCode: 9111100010 })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden &&
            params.ActionType !== 'a'
        ) {
            return new Promise((resolve) => {
                resolve({ retCode: 9111100011 })
            })
        }
        return $http.post(`${apiUrl.trade}v2/public/cpt/SendPositionAction`, params)
    },

    //市价反手
    SendPositionReverse: (params) => {
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.ip_access &&
            window.SwapTradeForbInfo.ip_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100010,
                })
            })
        }
        if (
            window.SwapTradeForbInfo &&
            window.SwapTradeForbInfo.area_code_access &&
            window.SwapTradeForbInfo.area_code_access.swap_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    retCode: 9111100011,
                })
            })
        }
        return $http.post(`${apiUrl.trade}v2/public/cpt/SendPositionReverse`, params)
    },
}

// 快捷买币相关接口
export const buyCrypto = {
    otcPrice: (params) => $http.get(apiUrl.wapi + '/v1/otc/price', params), //行情价
}

//合伙人api接口配置
export const partnerAPI = {
    inviteDataList: ({ start, end }) => $http.get(`${apiUrl.partnerUrl}api/v1/propa/code-stat-all`, { start, end }), // 邀请码数据统计
    sketchDetail: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/index/sketch-detail', params), //每日返佣详情
    platformRate: () => $http.get(`${apiUrl.partnerUrl}api/v1/platform-rate`), // 获取最大返佣比例
    checkout: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/is-agent'), //查询合伙人状态
    applyStatus: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/apply'), //代理商申请状态
    sendVerifyCode: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/apply-send-code', params), //发送验证码
    applySuperPost: (params) => $http.post(apiUrl.partnerUrl + 'api/v1/agent-apply-post', params), //超级合伙人申请提交表单
    sketch2: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/index/sketch', params), //用户首页基本数据2
    sketchList: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/index/sketch-list', params), //首页账户统计列表
    rangeStat2: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/index/range-stat', params), //区间统计图2
    propaStatistics2: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/propa/stat', params), //推广分组2
    makePropaLink: (params) => $http.post(apiUrl.partnerUrl + 'api/v1/propa/add', params), //生成推广链接
    listPropaLink: () => $http.get(apiUrl.partnerUrl + 'api/v1/propa/list'), //推广链接列表
    setDefaultInvite: ({ code }) => $http.post(`${apiUrl.partnerUrl}api/v1/propa/set-default`, { code }), // 设置默认邀请码
    invalidPropaLink: (params) => $http.post(apiUrl.partnerUrl + 'api/v1/propa/invalid', params), //删除推广链接
    editPropaLink: (params) => $http.post(apiUrl.partnerUrl + 'api/v1/propa/edit', params), //编辑推广链接
    rebateLog: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/rebate-log', params), //返佣记录
    rebateLogExport: (params) =>
        $http.get(apiUrl.partnerUrl + 'api/v1/user/rebate-log-export', params, undefined, 'blob'), //返佣记录导出
    blackLog: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/black-log', params), //待审核记录
    applink: (params) => $http.post(apiUrl.wapi + 'agent/invite-code', params), //获取普通合伙人分享id
    manageDowngrade2: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/manage-downgrade', params), //修改下级返佣配置
    agentList2: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/agent-list', params), //用户管理
    agentListV3: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/sub-agent-list', params), //用户管理
    exportAgentList: (params) =>
        $http.get(apiUrl.partnerUrl + 'api/v1/user/sub-agent-list-export', params, undefined, 'blob'), //导出用户管理
    invitedList: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/invited-list', params), //用户管理2
    balance: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/balance', params), //用户权益
    friendList: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/friend-list', params),
    remark: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/agent-remark', params), //备注
    contract: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/contract', params), //交易对
    trade: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/trade', params), //交易记录
    historyOrder: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/history-order', params), //历史普通委托
    position: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/position', params), //交易对
    moneyLog: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/money-log', params), //出入金汇总
    permission: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/user/permission', params), //导航列表
    activityList: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/activity/list', params), //活动列表
    userList: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/activity/user-list', params), //活动用户列表
    bulletin: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/index/bulletin', params), //公告列表
    total: (params) => $http.get(apiUrl.partnerUrl + 'api/v1/index/total', params), //首页总数据统计
    regLine: ({ start, end }) => $http.get(apiUrl.partnerUrl + 'api/v1/index/reg-broken-line', { start, end }), //拉新折线图
    rebateLine: ({ start, end }) => $http.get(apiUrl.partnerUrl + 'api/v1/index/rebate-broken-line', { start, end }), //返佣折线图
    tradeLine: ({ start, end }) => $http.get(apiUrl.partnerUrl + 'api/v1/index/trade-broken-line', { start, end }), //交易折线图
    inoutLine: ({ start, end }) => $http.get(apiUrl.partnerUrl + 'api/v1/index/inout-broken-line', { start, end }), //出入金折线图
}

export const mobileInvite = {
    userInfo: () => $http.get(`${apiUrl.partnerUrl}api/v1/propa/user-info`), // 用户信息
    platformRate: () => $http.get(`${apiUrl.partnerUrl}api/v1/platform-rate`), // 获取最大返佣比例
    inviteDataList: ({ code, start, end }) =>
        $http.get(`${apiUrl.partnerUrl}api/v1/propa/code-stat`, { code, start, end }), // 邀请码数据统计
    newInviteCode: ({ remark, rebate_rate, is_default }) =>
        $http.post(`${apiUrl.partnerUrl}api/v1/propa/add`, { remark, rebate_rate, is_default }), // 生成邀请码
    editInviteRemark: ({ remark, code }) => $http.post(`${apiUrl.partnerUrl}api/v1/propa/edit`, { remark, code }), // 修改邀请码备注
    inviteCodes: () => $http.get(`${apiUrl.partnerUrl}api/v1/propa/list`), // 邀请码列表
    setDefaultInvite: ({ code }) => $http.post(`${apiUrl.partnerUrl}api/v1/propa/set-default`, { code }), // 设置默认邀请码
    invitedFriends: ({ code }) => $http.get(`${apiUrl.partnerUrl}api/v1/propa/friends`, { code }), // 获取code对应的好友信息
    editFriendRemark: ({ remark, uid }) => $http.post(`${apiUrl.partnerUrl}api/v1/propa/user-remark`, { remark, uid }), // 修改邀请下级的备注
    accountBalance: (params) => $http.get(`${apiUrl.mapi}v1/balance/account-balance`, params),
    tradeRecord: (params) => $http.post(`${apiUrl.mapi}trade/record`, params),
    transfer: (params) => $http.post(`${apiUrl.mapi}transfer/transfer`, params),
}

//安全信息api接口配置
export const userSafeAPI = {
    account: () => $http.post(`${apiUrl.wapi}user/account`), //用户个人中心信息
    setPassword: (params) => $http.post(`${apiUrl.wapi}user/set-password`, params), //设置登录密码
    resetPassword: (params) => $http.post(`${apiUrl.wapi}user/reset-password`, params), //修改登录密码
    bindPhone: (params) => {
        //绑定手机号码
        if (!params.phone.includes('@') && window.areaCode) {
            params.area_code = window.areaCode
        }
        return $http.post(`${apiUrl.wapi}user/bind-phone`, params)
    },
    bindEmail: (params) => $http.post(`${apiUrl.wapi}user/bind-email`, params), //绑定邮箱
    getGoogle: () => $http.post(`${apiUrl.wapi}user/get-google-authenticator`), //获取谷歌秘钥
    bindGoogle: (params) => $http.post(`${apiUrl.wapi}user/bind-google-authenticator`, params), //绑定谷歌验证
    authList0: (params) => {
        //用户安全验证列表(未登录)
        if (!params.account.includes('@') && window.areaCode) {
            params.area_code = window.areaCode
        }
        return $http.post(`${apiUrl.wapi}common/auth-list`, params)
    },
    authList: (params) => $http.post(`${apiUrl.wapi}user/auth-list`, params), //用户安全验证列表(已登录)
    switchAuth: (params) => $http.post(`${apiUrl.wapi}user/switch-auth`, params), //安全认证方式开启/关闭
    login: (params) => {
        //用户登录
        if (!params.account.includes('@') && window.areaCode) {
            params.area_code = window.areaCode
        }
        return $http.post(`${apiUrl.wapi}center/common/login`, params)
    },
    register: (params) => {
        //用户注册
        if (!params.account.includes('@') && window.areaCode) {
            params.area_code = window.areaCode
        }
        return $http.post(`${apiUrl.wapi}center/common/register`, params)
    },
    loginCheck: (params) => $http.post(`${apiUrl.wapi}center/common/login-check`, params), //登录验证
    forgetPassword: (params) => $http.post(`${apiUrl.wapi}center/common/forget-password`, params), //用户忘记密码
    checkAuth: (params) => {
        //忘记密码安全校验
        if (!params.account.includes('@') && window.areaCode) {
            params.area_code = window.areaCode
        }
        return $http.post(`${apiUrl.wapi}common/check-auth`, params)
    },
    checkCode: (params) => {
        //验证短信 or 邮箱验证码
        if (!params.account.includes('@') && window.areaCode) {
            params.area_code = window.areaCode
        }
        return $http.post(`${apiUrl.wapi}common/check-code`, params)
    },
    countryList: (params) => $http.post(`${apiUrl.wapi}country/list-country`, params), //获取国家列表
    setCountry: (params) => $http.post(`${apiUrl.wapi}user/set-country`, params), //设置国家
    isSetCounrty: () => $http.post(`${apiUrl.wapi}user/is-set-country`), //是否已设置国家
    baseInfo: () => $http.post(`${apiUrl.wapi}user/base-info`), //用户基础信息
    syncToken: () => $http.post(`${apiUrl.wapi}user/sync-token`), //同步token到交易系统
    qiniuToken: (params) => $http.post(`${apiUrl.wapi}common/qiniu-token`, params), //七牛上传[不需要登录]
    unbindGoogle: (params) => $http.post(`${apiUrl.wapi}unbind-google/apply`, params),
    unbindCheckType: (params) => {
        if (!params.account.includes('@') && window.areaCode) {
            params.area_code = window.areaCode
        }
        //谷歌解绑-查看申请状态-未登录
        return $http.post(`${apiUrl.wapi}unbind-google/check-apply`, params)
    },
    needAssetPwd: (params) => $http.post(`${apiUrl.wapi}user/need-check-asset-pwd`, params), //否需要 验证资金密码
    checkAssetPwd: (params) => $http.post(`${apiUrl.wapi}user/check-asset-pwd`, params), //用户校验资金密码
    resetAssetPwd: (params) => $http.post(`${apiUrl.wapi}user/reset-asset-pwd`, params), //用户重置资金密码
    setAssetPwd: (params) => $http.post(`${apiUrl.wapi}user/set-asset-pwd`, params), //用户设置资金密码
    listDevices: (params) => $http.post(`${apiUrl.wapi}center/device/list`, params), //用户登录设备
    deleteDevice: (params) => $http.post(`${apiUrl.wapi}center/device/delete`, params), //删除用户登录设备
    loginLogs: (params) => $http.post(`${apiUrl.wapi}api/user/login/list`, params), //用户登录记录
    addFishcode: (params) => $http.post(`${apiUrl.wapi}api/user/fishcode/add`, params), //用户防钓鱼码
    userKycInfo: (params) => $http.post(`${apiUrl.wapi}api/otc/kyc/show`, params), //用户认证信息
    userKycSubmit: (params) => $http.post(`${apiUrl.wapi}api/otc/kyc/add`, params), //用户认证提交
    logindevices: (params) => $http.post(`${apiUrl.wapi}api/user/login/devices`, params), //用户当前登录设备
    deviceKickout: (params) => $http.post(`${apiUrl.wapi}api/user/login/kickout`, params), //踢出设备
    authEvents: (params) => $http.post(`${apiUrl.wapi}api/user/auth/events`, params), //操作记录
}

//api管理相关接口
export const apiMaangeFun = {
    apiSecretAdd: (params) => $http.post(`${apiUrl.wapi}api-secret/add`, params),
    apiSecretUpdate: (params) => $http.post(`${apiUrl.wapi}api-secret/update`, params),
    apiSecretDel: (params) => $http.post(`${apiUrl.wapi}api-secret/del`, params),
    apiSecretList: () => $http.post(`${apiUrl.wapi}api-secret/lists`),
}

//合约比赛相关接口
export const raceApi = {
    raceSignUp: (params) => $http.get(`${apiUrl.wapi}activity/sign-up`, params),
    raceInfo: (params) => $http.get(`${apiUrl.wapi}activity/info`, params),
    raceUserInfo: (params) => $http.get(`${apiUrl.wapi}activity/user-info`, params),
    raceList: (params) => $http.get(`${apiUrl.wapi}activity/rank-list`, params),
    raceEndList: (params) => $http.get(`${apiUrl.wapi}activity/rank-list-end`, params),
    racePrize: (params) => $http.get(`${apiUrl.wapi}activity/prize`, params),
    raceDescription: (params) => $http.get(`${apiUrl.wapi}activity/description`, params),
    raceShare: (params) => $http.get(`${apiUrl.wapi}activity/share`, params),
}

//现货相关接口
export const spotApi = {
    //获取合约列表-交易系统
    getContractListLink: (params) => {
        return $http.get(`${apiUrl.trade}query/v1.0/contract`, params)
    },
    //资产查询
    queryBalance: (params) => {
        return $http.get(`${apiUrl.trade}spotquery/v1.0/account`, params)
    },
    //k线历史
    getKline: (params, timeout) => {
        return $http.get(`${apiUrl.trade}spotquery/v1.0/kline`, params, timeout)
    },
    //k线历史2
    getKline2: (params, timeout) => {
        return $http.post(`${apiUrl.trade}spotquery/v1.0/kline`, params, timeout)
    },
    //成交记录
    queryTrade: (params) => {
        return $http.get(`${apiUrl.trade}spotquery/v1.0/trade`, params)
    },
    //一键撤单
    spotRvk: (params) => $http.post(`${apiUrl.trade}prism/action/spot/rvk`, params),
    //币种简介
    symbolIntro: (params) => {
        return $http.get(`${apiUrl.wapi}site/symbol-intro`, params)
    },
    // 限价、市价下单-带止盈止损
    SendCloseOrderInsert: (params) => {
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.ip_access &&
            window.SpotTradeForbInfo.ip_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100008',
                })
            })
        }
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.area_code_access &&
            window.SpotTradeForbInfo.area_code_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100009',
                })
            })
        }
        return $http._post(`${apiUrl.trade}spotaction/v1.0/SendCloseOrderInsert`, params)
    },
    // 买卖下单
    SendOrderInsert: (params) => {
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.ip_access &&
            window.SpotTradeForbInfo.ip_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100008',
                })
            })
        }
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.area_code_access &&
            window.SpotTradeForbInfo.area_code_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100009',
                })
            })
        }
        return $http._post(`${apiUrl.trade}spotaction/v1.0/SendOrderInsert`, params)
    },
    // 条件下单，不管有没有止盈止损，就这一个接口
    SendTriggerOrderInsert: (params) => {
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.ip_access &&
            window.SpotTradeForbInfo.ip_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100008',
                })
            })
        }
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.area_code_access &&
            window.SpotTradeForbInfo.area_code_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100009',
                })
            })
        }
        return $http.post(`${apiUrl.trade}spotaction/v1.0/SendTriggerOrderInsert`, params)
    },
    // 拉取价格
    priceList: (params) => {
        return $http.get(`${apiUrl.wapi}common/price-list`, params)
    },
    // 保存成本价
    saveOpenPrice: (params) => {
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.ip_access &&
            window.SpotTradeForbInfo.ip_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100008',
                })
            })
        }
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.area_code_access &&
            window.SpotTradeForbInfo.area_code_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100009',
                })
            })
        }
        return $http.post(`${apiUrl.trade}spotaction/v1.0/SendPositionAction`, params)
    },
    closePos: (params) => {
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.ip_access &&
            window.SpotTradeForbInfo.ip_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    code: '9111100008',
                })
            })
        }
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.area_code_access &&
            window.SpotTradeForbInfo.area_code_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    code: '9111100009',
                })
            })
        }
        return $http.post(`${apiUrl.trade}prism/action/spot/closePos`, params)
    },
    // 一把拉
    SendBatch: (params) => {
        return $http.post(`${apiUrl.trade}spotquery/v1.0/SendBatch`, params)
    },
    // 修改限价单
    SendOrderAction: (params) => {
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.ip_access &&
            window.SpotTradeForbInfo.ip_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100008',
                })
            })
        }
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.area_code_access &&
            window.SpotTradeForbInfo.area_code_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100009',
                })
            })
        }
        return $http.post(`${apiUrl.trade}spotaction/v1.0/SendOrderAction`, params)
    },
    // 修改带止盈止损的限价单
    SendCloseOrderAction: (params) => {
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.ip_access &&
            window.SpotTradeForbInfo.ip_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100008',
                })
            })
        }
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.area_code_access &&
            window.SpotTradeForbInfo.area_code_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100009',
                })
            })
        }
        return $http.post(`${apiUrl.trade}spotaction/v1.0/SendCloseOrderAction`, params)
    },
    // 修改止盈止损
    SendTriggerOrderAction: (params) => {
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.ip_access &&
            window.SpotTradeForbInfo.ip_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100008',
                })
            })
        }
        if (
            window.SpotTradeForbInfo &&
            window.SpotTradeForbInfo.area_code_access &&
            window.SpotTradeForbInfo.area_code_access.spot_forbiden
        ) {
            return new Promise((resolve) => {
                resolve({
                    errorCode: '9111100009',
                })
            })
        }
        return $http.post(`${apiUrl.trade}spotaction/v1.0/SendTriggerOrderAction`, params)
    },
    finishOrderV3: (params) => $http._get(`${apiUrl.trade}spotquery/v3.0/finish-orders`, params), //查询历史委托(近3个月)
    tradesV3: (params) => $http._get(`${apiUrl.trade}spotquery/v3.0/trades`, params), //查询成交记录(近3个月)
    finishTriggerOrderV3: (params) => $http._get(`${apiUrl.trade}spotquery/v3.0/finish-trigger-orders`, params), //查询历史条件单(近3个月)
    // boll 相关
    triggerRvk: (params) => $http.post(`${apiUrl.trade}prism/action/spot/trigger-rvk`, params), //指标单 一键撤单
}
export const indicatorsConfig = () => $http.get(`${apiUrl.trade}prism/indicators`) //获取指标权限配置信息

// 邮件订阅相关接口
export const subscribeApi = {
    // 获取订阅信息
    unsubscribe: (params) => {
        return $http.post(`${apiUrl.wapi}api/email/emailmanage/unsubscribe`, params)
    },
    // 获取全部订阅信息
    list: (params) => {
        return $http.post(`${apiUrl.wapi}api/email/emailmanage/list-type`, params)
    },
    // 保存订阅信息
    saveSubscribe: (params) => {
        return $http.post(`${apiUrl.wapi}api/email/emailmanage/operate`, params)
    },
}

// 内部转账相关接口
export const internalTransferApi = {
    // 内部转账币种
    getSymbolList: (params) => $http.get(`${apiUrl.wapi}internal-transfer/symbol-lists`, params),
    // 内部转出列表
    getOutList: (params) => $http.get(`${apiUrl.wapi}internal-transfer/out-list`, params),
    // 内部转入列表
    getInList: (params) => $http.get(`${apiUrl.wapi}internal-transfer/in-list`, params),
    // 内部转账
    transfer: (params) => {
        return $http.post(`${apiUrl.wapi}internal-transfer/transfer`, params)
    },
}

//商家后台管理接口
export const otcAdminApi = {
    //商家后台配置
    getConfig: () => {
        return $http.get(`${apiUrl.wapi}v1/merchant/config`)
    },
    //账户总览
    merchaantList: () => {
        return $http.get(`${apiUrl.wapi}v1/merchant/list`)
    },
    //是否商家-上下线状态
    getOnline: () => {
        return $http.get(`${apiUrl.wapi}v1/merchant/online`)
    },
    //上下线控制
    onlineType: (params) => {
        return $http.post(`${apiUrl.wapi}v1/merchant/switch`, params)
    },
    //商户收款方式-列表
    getList: (params) => {
        return $http.get(`${apiUrl.wapi}api/otc/platcard/list`, params)
    },
    //商户收款方式-添加
    add: (params) => {
        return $http.post(`${apiUrl.wapi}api/otc/platcard/add`, params)
    },
    //商户收款方式-更新
    update: (params) => {
        return $http.post(`${apiUrl.wapi}api/otc/platcard/update`, params)
    },
    //商户收款方式-更新
    switch: (params) => {
        return $http.post(`${apiUrl.wapi}api/otc/platcard/switch`, params)
    },
    //商户收款方式-删除
    delete: (params) => {
        return $http.post(`${apiUrl.wapi}api/otc/platcard/delete`, params)
    },
    //商户收款方式-法币列表
    paymethod: () => {
        return $http.post(`${apiUrl.wapi}api/otc/config/paymethod`)
    },
    //收款方式配置
    paymethodList: () => {
        return $http.post(`${apiUrl.wapi}api/otc/paymethod/list`)
    },
    //商户充值审核
    rechargeAudi: (params) => {
        return $http.post(`${apiUrl.wapi}v1/merchant/recharge-audit`, params)
    },
    //商户出金审核
    withdrawAudi: (params) => {
        return $http.post(`${apiUrl.wapi}v1/merchant/withdraw-audit`, params)
    },
    //买币审核列表
    rechargeList: (params) => {
        return $http.get(`${apiUrl.wapi}v1/merchant/recharge-check-list`, params)
    },
    //卖币审核列表
    withdrawList: (params) => {
        return $http.get(`${apiUrl.wapi}v1/merchant/withdraw-check-list`, params)
    },
    //设置价格
    setPrice: (params) => {
        return $http.post(`${apiUrl.wapi}v1/merchant/set-price`, params)
    },
    //获取价格
    getOtcPrice: (params) => {
        return $http.get(`${apiUrl.wapi}v1/otc/price`, params)
    },
    //获取消息推送配置
    getMsgConfig: () => {
        return $http.get(`${apiUrl.wapi}v1/merchant/get-msg-config`)
    },
    //设置消息推送配置
    setMsgConfig: (params) => {
        return $http.post(`${apiUrl.wapi}v1/merchant/set-msg`, params)
    },
    //获取KYC认证状态信息
    getNewKycInfo: () => {
        return $http.get(`${apiUrl.wapi}api/otc/kyc/show`)
    },

    //获取收款方式字段属性
    getCollectionObj: (params) => {
        return $http.get(`${apiUrl.wapi}api/otc/paymethod/field`, params)
    },
    //商家后台-取消买币
    rechargeCancel: (params) => {
        return $http.post(`${apiUrl.wapi}v1/merchant/recharge-cancel`, params)
    },
    //取消卖币
    withdrawCancel: (params) => {
        return $http.post(`${apiUrl.wapi}v1/merchant/withdraw-cancel`, params)
    },
}

// 上币专区
export const symbolZone = (params) => $http.get(`${apiUrl.wapi}common/symbol-zone`, params)

// 上币申请
export const applycurrency = (params) => $http.post(`${apiUrl.wapi}api/common/apply/add`, params)

// 对外api相关接口
export const apiMgr = {
    // 获取api列表
    list: (params) => {
        return $http.get(`${apiUrl.trade}deepcoin/user/api-secret/list`, params)
    },
    //创建单个 API Key
    create: (params) => {
        return $http.post(`${apiUrl.trade}deepcoin/user/api-secret/create`, params)
    },
    //删除单个 API Key
    delete: (params) => {
        return $http.post(`${apiUrl.trade}deepcoin/user/api-secret/delete`, params)
    },
    //查看单个 API Key
    detail: (params) => {
        return $http.post(`${apiUrl.trade}deepcoin/user/api-secret/detail`, params)
    },
    //重置单个 API Key
    update: (params) => {
        return $http.post(`${apiUrl.trade}deepcoin/user/api-secret/update`, params)
    },
    //发送邮箱验证码
    sendmail: (params) => {
        return $http.post(`${apiUrl.trade}deepcoin/user/email-code/send`, params)
    },
    //发送短信验证码
    sendphone: (params) => {
        return $http.post(`${apiUrl.trade}deepcoin/user/phone-code/send`, params)
    },
    //获取用户绑定信息
    authlist: (params) => {
        return $http.post(`${apiUrl.wapi}user/auth-list`, params)
    },
}
// 首页行情榜
export const ranklist = (params) => {
    return $http.get(`${apiUrl.wapi}api/common/rank/list`, params)
}
// 盈亏分析
export const analysisApi = {
    // 概览
    overview: (params) => {
        return $http.get(`${apiUrl.trade}prism/asset/analysis/overview`, params)
    },
    // 资产分布
    assetsAllocation: (params) => {
        return $http.get(`${apiUrl.trade}prism/asset/analysis/assetsAllocation`, params)
    },
    // 资产分析 资产走势
    assetsTrend: (params) => {
        return $http.get(`${apiUrl.trade}prism/asset/analysis/assetsTrend`, params)
    },
    // 币种列表
    currencyList: (params) => {
        return $http.get(`${apiUrl.trade}prism/asset/analysis/currencyList`, params)
    },
    // 获取今日收益分布(收益来源)
    dailyPnlAllocation: (params) => {
        return $http.get(`${apiUrl.trade}prism/asset/analysis/dailyPnlAllocation`, params)
    },
    // 获取累计收益分布(收益榜)
    totalPnlAllocation: (params) => {
        return $http.get(`${apiUrl.trade}prism/asset/analysis/totalPnlAllocation`, params)
    },
    // 获取盈亏分析趋势 累计收益率，累计收益，每日收益，资产总值一起返回
    trend: (params) => {
        return $http.get(`${apiUrl.trade}prism/asset/analysis/trend`, params)
    },
    // 获取当前时间
    time: () => {
        return $http.get(`${apiUrl.trade}prism/time`)
    },
}

// 加入社群
export const socialList = (params) => {
    return $http.get(`${apiUrl.wapi}api/common/social/list`, params)
}

// 福利中心相关接口
export const welfarelApi = {
    //获取任务列表
    tasks: (params) => {
        return $http.get(`${apiUrl.wapi}api/welfare/center/tasks`, params)
    },
    //领取奖励
    receive: (params) => {
        return $http.get(`${apiUrl.wapi}api/welfare/center/receive`, params)
    },
    //获取待领取金额
    profit: (params) => {
        return $http.post(`${apiUrl.wapi}bonus/profit-list`, params)
    },
    //卡券列表
    coupon: (params) => {
        return $http.post(`${apiUrl.wapi}api/present/present/list-coupon`, params)
    },
    //过期提醒
    notice: (params) => {
        return $http.post(`${apiUrl.wapi}api/welfare/center/expire-notice`, params)
    },
    //卡券列表-新
    couponlist: (params) => {
        return $http.post(`${apiUrl.wapi}api/welfare/center/coupon-list`, params)
    },
    //当前使用抵扣金比例
    deduction: (params) => {
        return $http.post(`${apiUrl.wapi}api/deduction/deduction/list-use-info`, params)
    },
}
//前端触发后台统计
export const loginst = (params) => {
    return $http.get(`${apiUrl.wapi}api/common/statistic/st`, params)
}

//弹窗通过接口
export const popList = (params) => {
    return $http.get(`${apiUrl.wapi}api/common/pop/list`, params)
}

// 获取汇率 /v1/balance/fiat-rate
export const fiatRate = (params) => {
    return $http.get(`${apiUrl.wapi}v1/balance/fiat-rate`, params)
}

//直播列表
// export const liveList = params => $http.post(`${apiUrl.wapi}dcLive/live/list`,params);                          //直播列表
export const liveNewsList = (params) => $http.post(`${apiUrl.wapi}dcLive/live/news/list`, params) //7x24小时快讯列表
export const liveGetUserInfo = (params) => $http.post(`${apiUrl.wapi}dcLive/live/get-user-info`, params) //获取用户信息
export const liveMessageList = (params) => $http.post(`${apiUrl.wapi}dcLive/message/list`, params) //历史消息列表
export const liveGoodMessageList = (params) => $http.post(`${apiUrl.wapi}dcLive/good/list`, params) //精华列表
export const liveHistoryInfo = (params) => $http.post(`${apiUrl.wapi}dcLive/live/history-info`, params) //历史直播间room信息
export const liveMsgTranslation = (params) => $http.post(`${apiUrl.wapi}dcLive/live/message/translation`, params) //翻译
export const liveMsgDelete = (params) => $http.post(`${apiUrl.wapi}dcLive/message/del`, params) //历史直播间消息删除
export const liveMsgGoodsOp = (params) => $http.post(`${apiUrl.wapi}dcLive/goods/operate`, params) //分析精华-加精/取消加精
export const liveShutUp = (params) => $http.post(`${apiUrl.wapi}dcLive/shut-up/operate`, params) //历史直播间禁言
export const livetranslation = (params) => $http.post(`${apiUrl.wapi}dcLive/live/input/translation`, params) //google翻译
export const liveShupList = (params) => $http.post(`${apiUrl.wapi}dcLive/shutUp/list`, params) //历史直播间禁言列表
export const liveGraphicPlazaList = (params) => $http.post(`${apiUrl.wapi}dcLive/community/list`, params) //直播广场列表
export const liveGraphicRoomList = (params) => $http.post(`${apiUrl.wapi}dcLive/room/list`, params) //直播间列表
export const liveGraphicRoomLiving = (params) => $http.post(`${apiUrl.wapi}dcLive/live/index`, params) //社区入口直播间
export const liveGraphicReplyCenter = (params) => $http.post(`${apiUrl.wapi}dcLive/reply/center`, params) //社区入口直播间

//获取语言列表
export const languagelist = (params) => $http.post(`${apiUrl.wapi}api/language/language/list`, params)

//获取 福利中心 是否有提示小红点
export const welfarelnotice = (params) => $http.get(`${apiUrl.wapi}common/notice`, params)

//获取首页 新手引导内容
export const guide = (params) => $http.get(`${apiUrl.wapi}api/common/guide/list`, params)

// K线买卖点聚合查询
export const getBsPointList = (params) => $http.get(`${apiUrl.trade}prism/kmeu/bspoint/list`, params)

//合约比赛相关接口
export const matchApi = {
    //获取比赛列表list
    group: (params) => {
        return $http.get(`${apiUrl.game}group`, params)
    },
    //获取比赛信息info
    info: (params) => {
        return $http.get(`${apiUrl.game}info`, params)
    },
    //获取排行榜信息
    rank: (params) => {
        return $http.get(`${apiUrl.game}rank-list`, params)
    },
    //获取用户信息
    user: (params) => {
        return $http.get(`${apiUrl.game}account`, params)
    },
    //获取比赛奖池信息
    prizeList: (params) => {
        return $http.get(`${apiUrl.game}prize-list`, params)
    },
    //判断当前用户是否可交易
    pass: (params) => {
        return $http.get(`${apiUrl.game}pass`, params)
    },
    //报名
    apply: (params) => {
        return $http.get(`${apiUrl.game}apply`, params)
    },
    //根据hash获取用户信息
    hashInfo: (params) => {
        return $http.get(`${apiUrl.game}share-account/${params}`)
    },
    //拉取历史成交数据
    getDealHistoryList: (params) => {
        return $http.get(`${apiUrl.game}share-order`, params)
    },
    //获取外部平台是否已接入列表
    platformList: (params) => {
        return $http.get(`${apiUrl.game}platform-list`, params)
    },
    //外部比赛报名
    embedApi: (params) => {
        return $http.get(`${apiUrl.game}embed-api`, params)
    },
    //跟单比赛排名
    followOrderRank: ({ id }) => {
        return $http.get(`${apiUrl.game}team-rank-list`, { id })
    },
}
//充提币-公告
export const getTransNotice = (params) => $http.get(`${apiUrl.wapi}v1/currency-transaction/notice`, params)

export const redpacketAPI = {
    taskList: () => $http.get(`${apiUrl.mapi}red-packet/task-list-new`),
    otcConfig: () => $http.post(`${apiUrl.mapi}otc/otc-config`),
    getCountAction: (key) => $http.get(`${apiUrl.mapi}red-packet/add-times?type=${key}`),
    getRedPackageTotal: () => $http.get(`${apiUrl.mapi}red-packet/total`),
    redPackageList: (params) => $http.get(`${apiUrl.mapi}red-packet/packet-list`, params),
    getSendList: (params) => $http.get(`${apiUrl.mapi}red-packet/send-list`, params),
    getUserPacketList: (params) => $http.get(`${apiUrl.mapi}red-packet/user-packet-list`, params),
    getCurrencies: () => $http.get(`${apiUrl.mapi}red-packet/currency-list`),
    getExchangeInfo: (params) => $http.get(`${apiUrl.mapi}red-packet/exchange`, params),
    getExchangeConfig: () => $http.get(`${apiUrl.mapi}site/exchange-config`),
    getExchangeList: (params) => $http.get(`${apiUrl.mapi}red-packet/exchange-list`, params),
    getPacket: (params) => $http.post(`${apiUrl.mapi}red-packet/get-packet`, params),
}

//获取首页Banner-新
export const getBannerList = (params) => $http.get(`${apiUrl.wapi}api/banner/banner/list`, params)
export const mobileGeneralAPI = {
    verifiedInfo: (params) => $http.post(`${apiUrl.mapi}user/verified-info`, params),
}
// 闪兑
export const exchangeApi = {
    //获取配置列表
    config: (params) => {
        return $http.get(`${apiUrl.wapi}conversion/config`, params)
    },
    //获取闪兑汇率
    rate: (params) => {
        return $http.get(`${apiUrl.wapi}conversion/rate`, params)
    },
    //获取闪兑记录
    list: (params) => {
        return $http.get(`${apiUrl.wapi}conversion/list`, params)
    },
    //兑换
    exchange: (params) => {
        return $http.post(`${apiUrl.wapi}conversion/exchange`, params)
    },
}

export const commonActivityList = ({ page, size }) =>
    $http.get(apiUrl.wapi + 'api/activity/general/list', { page, size }) //通用活动列表

export const commonActivityJoin = ({ uid, act_id }) => {
    const prams = { act_id }
    if (uid) prams.uid = uid
    return $http.get(apiUrl.wapi + 'api/activity/general/apply', prams) //通用活动参与
}

//活动提示信息-交易界面展示
export const gameTips = (params) => $http.get(`${apiUrl.game}notice`, params)

// 消息中心列表
export const notifyList = (params) => $http.post(`${apiUrl.wapi}api/notice/tradenotice/notify-list`, params)

//获取aicoin广告图片
export const adList = (params) => $http.post(`${apiUrl.wapi}api/activity/ad/list`, params)
// 跟单相关接口
export const appendApi = {
    //设置个人信息
    settings: (params) => {
        return $http.post(`${apiUrl.trade}prism/copytrade/base-info`, params)
    },
    //获取首页关注信息列表
    rankInfo: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/attention-info`, params)
    },
    //关注列表（全部）
    attention: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/attention-list`, params)
    },
    //粉丝列表
    fans: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/fans-list`, params)
    },
    //合约交易达人列表
    rank: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/trader-rank`, params)
    },
    //主页信息：
    homepage: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/homepage`, params)
    },
    // 跟单主页信息
    copytradeHomepage: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/copytrade-homepage`, params)
    },
    //变更订阅码
    changeCode: (params) => {
        return $http.get(`${apiUrl.trade}prism/followorder/change-code`, params)
    },
    //达人搜索
    search: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/search`, params)
    },
    //关注用户
    follow: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/attend-or-not`, params)
    },
    //是否进行消息通知
    notice: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/notice-or-not`, params)
    },
    //订阅用户
    subscribe: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/subscribe`, params)
    },
    //当前持仓
    position: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/trade-position`, params)
    },
    //历史操作
    hisope: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/trade-his-position-operations`, params)
    },
    //带单-头部信息
    trackOrderHeader: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/track-order-header`, params)
    },
    // 开启or关闭带单
    tradeStatus: (params) => {
        return $http.post(`${apiUrl.trade}prism/copytrade/lead-trade-status`, params)
    },
    // 带单-统计数据
    leadTradeData:(params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/lead-trade-stat`, params)
    },
    // 带单-历史带单
    positionHistory:(params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/lead-trade-history`, params)
    },
    // 带单-历史操作
    positionHistoryOpe: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/position-history-operations`, params)
    },
    // 带单-跟单者（当前跟单+历史跟单）
    followerRank: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/follower-rank`, params)
    },
    // 带单-当前带单
    leaderPosition: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/leader-position`, params)
    },
    // 跟单-头部数据
    copyTrade: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/copy-trade-header`, params)
    },
    //跟单-我的交易员
    trader:(params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/my-traders`, params)
    },
    // 获取跟单设置数据
    copytradeSettings: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/settings`, params)
    },
    //提交跟单设置
    copytradeSetSubmit: (params) => {
        return $http.post(`${apiUrl.trade}prism/copytrade/settings`, params)
    },
    //停止跟单
    stopFollowing: (params) => {
        return $http.post(`${apiUrl.trade}prism/copytrade/stop-following`, params)
    },
    //跟单-历史跟单  明细
    followedPositions:(params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/copy-trade-history`, params)
    },
    // 跟单-当前跟单
    followingPositions: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/following-positions`, params)
    },

    //下单页-设置仓位模式
    positionType: (params) => {
        return $http.post(`${apiUrl.trade}prism/copytrade/position-type`, params)
    },
    //下单页-获取交易员信息
    traderInfo: (params) => {
        return $http.post(`${apiUrl.trade}prism/copytrade/trader-info`, params)
    },

    //交易数据-tab头部
    tradeHeader: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/trade-header`, params)
    },
    // 交易数据-统计数据
    tradeData:(params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/lead-trade-all-stat`, params)
    },

    // 跟单后校验跟单密码
    checkCopyCode: (params) => {
        return $http.post(`${apiUrl.trade}prism/copytrade/check-copy-code`, params)
    },

    // 帮助中心跳转地址
    helpcenter: (params) => {
        return $http.get(`${apiUrl.wapi}api/helpcenter/helpcenter/jump`, params)
    },

    //获取预计待分润
    estimateProfit: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/current-estimate-profit`, params)
    },

    //获取历史分润列表
    historyProfit: (params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/history-profit`, params)
    },

    //选择带单币种
    leadTraderContracts: (params) => {
        return $http.post(`${apiUrl.trade}prism/copytrade/lead-trader-contracts`, params)
    },
    
    //获取分享图片
    shareImg:(params) => {
        return $http.get(`${apiUrl.wapi}api/share/share/list-img`, params)
    },

    //获取盈利播报信息
    getProfitReport:(params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/profit-report`, params)
    },

    //删除带单员
    delTrader: (params) => {
        return $http.post(`${apiUrl.trade}prism/copytrade/del-my-trader`, params)
    },

    // 停止跟单前检查仓位
    checkPosition:(params) => {
        return $http.post(`${apiUrl.trade}prism/copytrade/has-position-check`, params)
    },

    //有订单的交易员列表 
    myLeadTraders:(params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/my-lead-traders`, params)
    },
    //无仓位情况下，直接停止跟单
    directStopFollow:(params) => {
        return $http.post(`${apiUrl.trade}prism/copytrade/direct-stop-follow`, params)
    },
    //跟单-历史跟单  汇总
    followedPositionsAll:(params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/copy-trade-history-stat`, params)
    },
    //根据仓位id查看明细
    operationDetail:(params) => {
        return $http.get(`${apiUrl.trade}prism/copytrade/operation-detail-by-position-id`, params)
    },
}

//是否提币限制
export const withdrawLimit = (params) => $http.post(`${apiUrl.wapi}api/welfare/withdrawlimit/check`, params)

// 划线相关
export const drawLineApi = {
    saveLine: (params) => {
        return $http.post(`${apiUrl.wapi}indicator/save-line`, params)
    },
    queryLine: (params) => {
        return $http.post(`${apiUrl.wapi}indicator/query-line`, params)
    },
    deleteLine: (params) => {
        return $http.post(`${apiUrl.wapi}indicator/delete-line`, params)
    },
    deleteAllLine: (params) => {
        return $http.post(`${apiUrl.wapi}indicator/delete-all-line`, params)
    },
    updateLine: (params) => {
        return $http.post(`${apiUrl.wapi}indicator/update-line`, params)
    },
    updateLineSignal: (params) => {
        return $http.post(`${apiUrl.wapi}indicator/update-line-single`, params)
    },
}
//保存指标
export const saveClock = (params) => $http.post(`${apiUrl.wapi}indicator/save-clock`, params)
//提醒list
export const listClock = (params) => $http.post(`${apiUrl.wapi}indicator/list-clock`, params)
//删除提醒
export const deleteClock = (params) => $http.post(`${apiUrl.wapi}indicator/delete-clock`, params)
//更新提醒
export const updateClock = (params) => $http.post(`${apiUrl.wapi}indicator/update-clock`, params)
//获取客服配置信息
export const udeskConfig = (params) => $http.get(`${apiUrl.wapi}api/user/user/group`, params)
